﻿using AnesSystem.Models;
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem.Services
{
    public class VitalSignCacheService : BaseService<VitalSignCacheService, VitalSignCacheModel>
    {
        #region Variables


        #endregion


        #region Constructor

        #endregion


        #region Properties


        #endregion


        #region 依赖属性


        #endregion


        #region Event


        #endregion


        #region PrivateMethods


        #endregion


        #region Public/ProtectedMethods
        /// <summary>
        /// 获取一段时间内采集体征数据
        /// </summary>
        /// <param name="operRoom"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public List<VitalSignCacheModel> FindRangeSigns(string operRoom,DateTime startTime,DateTime endTime)
        {
            var filter = Builders<BsonDocument>.Filter;
            var query = Builders<BsonDocument>.Filter.And(filter.Eq("roomNo", operRoom),
                                                          filter.Gte("captureTime", startTime),
                                                          filter.Lte("captureTime", endTime));
            return FindAll(query).ToList();
        }

        #endregion


        #region EventHandlers


        #endregion
    }
}
